<?php include $this->admin_tpl('header');?>
<style>
    .layui-btn-group .webuploader-container > div:nth-of-type(2) input {
        display: none
    }
    #file-list-page{position: fixed;bottom: 3rem;}

</style>

<body>
<form class="layui-form file-library">
    <div class="mainBox">
        <div class="main-container">
            <div class="layui-row layui-layer-content layui-form ">
                <div class="layui-col-sm2" style="z-index: 10;">
                    <div class="file-group">
                        <ul class="nav-new">
                            <li class="ng-scope active" data-group-id="-1">
                                <a class="group-name am-text-truncate" href="javascript:void(0);" title="全部">全部</a>
                            </li>
                            <li class="ng-scope" data-group-id="0">
                                <a class="group-name am-text-truncate" href="javascript:void(0);"
                                   title="未分组">未分组</a>
                            </li>
                            <?php
                            foreach($group_list as $vo) {
                            ?>
                            <li class="ng-scope" data-group-id="<?php echo $vo['group_id']; ?>"
                                title="<?php echo $vo['group_name']; ?>">
                                <a class="group-edit" href="javascript:void(0);" title="编辑分组">
                                    <i class="layui-icon layui-icon-edit"></i>
                                </a>
                                <a class="group-name am-text-truncate" href="javascript:void(0);">
                                    <?php echo $vo['group_name']; ?>
                                </a>
                                <a class="group-delete" href="javascript:void(0);" title="删除分组">
                                    <i class="layui-icon layui-icon-delete"></i>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                        <a class="group-add" href="javascript:void(0);">新增分组</a>
                    </div>
                </div>
                <div class="layui-col-sm10">
                    <div class="layui-btn-group" style="padding-top: 5px;">
                        <ul class="layui-nav layui-bg-green" lay-filter=""
                            style="font-size: 12px;border-radius: 0px;float: left;padding:0px 0px 0px 0px;margin-left: 2px;margin-right:4px;">
                            <li class="layui-nav-item group-select" style="line-height: 30px;font-size: 12px;">
                                <a href="javascript:;" class="am-dropdown-toggle"
                                   style="width:65px;color:white;font-size: 12px;padding: 0px 20px 0px 20px;background: #3bb4f2">移动至<span
                                        class="layui-nav-more" style="right: 10px;font-size: 12px;"><i
                                        class="layui-icon layui-icon-triangle-d"></i>   </span></a>
                                <dl class="layui-nav-child"
                                    style="top: 30px;line-height: 31px;padding: 0px 0px 0px 0px;">
                                </dl>
                            </li>
                        </ul>
                        <span style="margin-right:4px;"><a class="layui-btn layui-btn-danger layui-btn-sm file-delete"
                                                           style="">删除</a></span>

                        <button type="button" class="layui-btn layui-btn-lvse layui-btn-sm j-upload upload-image"
                                id="lay_pic" data-input-id="c-pic" data-type="image">
                            <i class="layui-icon"></i>上传图片
                        </button>

                    </div>
                    <div id="file-list-body" class="v-box-body"></div>
                    <div id="file-list-page"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <a class="pear-btn pear-btn-primary pear-btn-sm btn-sure">&nbsp;&nbsp;确定&nbsp;&nbsp;</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a onclick="window.close()" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                关闭
            </a>
        </div>
    </div>
</form>

<?php include $this->admin_tpl('footer');?>
<script>
  layui.use(['form', 'jquery', 'fileLibrary', 'webuploader'], function () {
    var form = layui.form, $ = layui.jquery;

    var body_height = $(window).height();
    var content_height = Number(body_height) - 160;
    console.log(body_height);
    console.log(content_height);
    $('#file-list-item').css('height', content_height + 'px');

    form.render();
    $('.file-library').fileLibrary({
      input_type: "<?php echo $type;?>",
      select_id: "<?php echo $select_id; ?>"
    });
  });
</script>
</body>
</html>
